<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ page language="java" import="com.zhuozhengsoft.pageoffice.*" %>
<%@ page language="java" import="com.zhuozhengsoft.pageoffice.wordwriter.*" %>
<%@ taglib uri="http://java.pageoffice.cn" prefix="po" %> 
<% 
	String title = (String)request.getAttribute("fileTitle");
    WordDocument docx = (WordDocument)request.getAttribute("docx");
	String url = (String)request.getAttribute("filePath");
	PageOfficeCtrl poCtrl = new PageOfficeCtrl(request);
	//设置打开的Word文档的主题
	poCtrl.setTheme(ThemeType.Office2010);
	//隐藏Office工具条
	poCtrl.setOfficeToolbars(false);
	//隐藏自定义工具栏
	poCtrl.setCustomToolbar(false);
	//设置页面的显示标题
	poCtrl.setCaption(title);
	poCtrl.setWriter(docx);
	
	/* //设置office办公软件类型
	poCtrl.setOfficeVendor(OfficeVendorType.WPSOffice); */
	
	poCtrl.setServerPage(request.getContextPath()+"/poserver.do"); //此行必须
	//添加自定义按钮
	poCtrl.addCustomToolButton("保存","Save()",1);
	//设置保存页面
	poCtrl.setSaveFilePage(request.getContextPath()+url);
	poCtrl.webCreateNew("武汉思恒达科技有限公司",DocumentVersion.Word2007);
	poCtrl.setJsFunction_AfterDocumentSaved("AfterDocumentSaved");
	poCtrl.setTagId("PageOfficeCtrl"); //此行必须	 
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>合成</title>
</head>
<body>
<input type="hidden" id="project_id" value="${obj.project_id}">
<input type="hidden" id="fileTitle" value="${obj.fileTitle}">
<input type="hidden" id="docx" value="${obj.docx}">
<input type="hidden" id="filePath" value="${obj.filePath}">

<div style=" width:auto; height:750px;width:1280px;margin: 0 auto;">
	<po:PageOfficeCtrl id="PageOfficeCtrl"></po:PageOfficeCtrl>
</div>  
</body>
<script type="text/javascript">
function Save() {
    document.getElementById("PageOfficeCtrl").WebSave();
}

function AfterDocumentSaved(){
	alert("保存成功");
	layer.msg('保存成功。', {
		icon : 6
	});
	setTimeout(function() {
	}, 1500);
}
</script>
</html>